package com.cnhis.cloudhealth.clidoctorweb.test;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang.time.DateFormatUtils;

import com.alibaba.dubbo.config.annotation.Reference;
import com.cnhis.cloudhealth.clidoctorweb.clisendadvice.CliSendAdviceRest;
import com.cnhis.cloudhealth.commons.Mappers.ModelVo;

import net.sf.json.JSONObject;

    
    public class Mythread_web extends Thread
    {
public static void main(String[] args) {
	
}
        private int i;
        
        public Mythread_web(int i)
        {
            this.i = i;
        }

        @Reference
        private static CliSendAdviceRest cliSendAdviceRest;

        @Override
        public void run() {
            System.out.println(DateFormatUtils.format(new Date(),"yyyy-MM-dd HH:mm:ss:ms")+"  "+Thread.currentThread().getName()+"  visit"); 
            ModelVo mo = new ModelVo();
            Map map = new HashMap();
            map.put("savePrintList","[]");
            Map<String, Object> lXml = new HashMap<>();
            List<Map<String,Object>> zjAddList = new ArrayList<Map<String,Object>>();
            List<Map<String,Object>> vaf1List = new ArrayList<Map<String,Object>>();
            List<Map<String,Object>> vbd1List = new ArrayList<Map<String,Object>>();
            List<Map<String,Object>> zjList = new ArrayList<Map<String,Object>>();
            Map<String, Object> vaf01 = new HashMap<String, Object>();
            vaf01.put("vaf01", 959001344616697859L);
            vaf1List.add(vaf01);
            Map<String, Object> vbd01 = new HashMap<String, Object>();
            vbd01.put("vaf01", 959001344616697859L);
            vbd01.put("bby01", 5583);
            vbd01.put("vbd04", 1);
            vbd01.put("bby25", 2.5);
            vbd01.put("vbd05", 2.5);
            vbd01.put("vbd06", 0);
            vbd01.put("bck01", 15);
            vbd01.put("bdn01", "1");
            vbd01.put("vbd08", 1);
            vbd01.put("vbd09", 0);
            vbd01.put("dsk01", 1507);
            vbd01.put("bby01a", 0);
            vbd01.put("vbd12", 1);
            vbd01.put("bag05", 1);
            vbd01.put("bby05", "葡萄糖酸钙注射液");
            vbd1List.add(vbd01);
            Map<String, Object> vbd02 = new HashMap<String, Object>();
            vbd02.put("vaf01", 959001344616697858L);
            vbd02.put("bby01", 0);
            vbd02.put("vbd04", 1);
            vbd02.put("bby25", 11.4);
            vbd02.put("vbd05", 11.4);
            vbd02.put("vbd06", 0);
            vbd02.put("bck01", 15);
            vbd02.put("bdn01", "Z");
            vbd02.put("vbd08", 1);
            vbd02.put("vbd09", 0);
            vbd02.put("dsk01", 0);
            vbd02.put("bby01a", 0);
            vbd02.put("vbd12", 1);
            vbd02.put("bag05", 0);
            vbd02.put("bby05", "门诊静脉输液");
            vbd1List.add(vbd02);
            lXml.put("VAF1", vaf1List);
            lXml.put("VBD1", vbd1List);
            lXml.put("zjAddList", zjAddList);
            map.put("lXml",JSONObject.fromObject(lXml).toString());
            map.put("lSign",2);
            map.put("lBCE01",1);
            map.put("lBCE02","");
            map.put("lBCE03","管理员");
            map.put("lBCK01",10);
            map.put("lACF01",1);
            map.put("lVAA07",957887978649296896L);
            map.put("lVAA01",956344253527760896L);
            map.put("lVer",i);
            String params = "";
            params += "lVAA01=953076363307393024&lVAA07=953076363307393025&lACF01=1&lBCK01=30&lBCE03=\"管理员\"&lBCE02=\"\"&lBCE01=1&lSign=2&savePrintList=\"[]\"&lXml=\""+JSONObject.fromObject(lXml).toString()+"\"";
             try {
                 String url="http://localhost:8080/clidoctorweb/cloud/clisendadvice/clinicadvicesend";
                 String result = new HttpClientUtil().doPost(url, map, "utf-8");
                 System.out.println("**************************************"+result);
            } catch (Exception e) {
                e.printStackTrace();
            }
            
        }
    }
    
